Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: agent get SPD syncly #558

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ddjjia
Copy link
Contributor

@ddjjia ddjjia commented Apr 23, 2024

What type of PR is this?

Features

What this PR does / why we need it:

get spd from remote if not in cache when GetFromRemote is true

Which issue(s) this PR fixes:

Special notes for your reviewer:

@CLAassistant
Copy link

CLAassistant commented Apr 23, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 53.84615% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 55.90%. Comparing base (74b648c) to head (b49efba).

❗ Current head b49efba differs from pull request most recent head d57b8bb. Consider uploading reports for the commit d57b8bb to get more accurate results

Files Patch % Lines
pkg/metaserver/spd/fetcher.go 52.17% 8 Missing and 3 partials ⚠️
...atalyst-agent/app/options/metaserver/metaserver.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #558      +/-   ##
==========================================
- Coverage   56.06%   55.90%   -0.17%     
==========================================
  Files         534      534              
  Lines       49807    49828      +21     
==========================================
- Hits        27924    27856      -68     
- Misses      18325    18420      +95     
+ Partials     3558     3552       -6     
Flag Coverage Δ
unittest 55.90% <53.84%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddjjia ddjjia force-pushed the feat/spdfetcher-updateSPDCache-from-latest branch from eb05ece to a2ba65b Compare April 27, 2024 00:18
@ddjjia ddjjia force-pushed the feat/spdfetcher-updateSPDCache-from-latest branch from 90f3a7e to 0ce43ec Compare May 4, 2024 05:23
@@ -159,6 +161,28 @@ func (s *spdFetcher) getSPDByNamespaceName(_ context.Context, namespace, name st
currentSPD := s.spdCache.GetSPD(key, true)
if currentSPD != nil {
return currentSPD, nil
} else if s.getFromRemote {
klog.Infof("[spd-manager] need to get spd %s from remote", key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic in the getSPDByNamespaceName can be abstracted into a function with the logic in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants